package com.banmoon.state;

/**
 * 半血状态
 */
public class HalfHpState extends AbstractState{

    private Person person;

    public HalfHpState(Person person, int hp) {
        super(hp);
        this.person = person;
    }

    @Override
    public void takeMedicine() {
        System.out.println("快吃药~");
        int i = super.getHp() + 30;
        if(i>=100){
            person.setState(new FullHpState(person));
        }
    }

    @Override
    public void resurrect() {
        System.out.println("还活着，你复活啥?");
    }

    @Override
    public void adventure() {
        Person.adventure(person);
    }

    public void updateHp(int hp) {
        super.setHp(hp);
    }
}
